#pragma once
#include<string>
#include<iostream>
#include <rpcFw\Variant.h>
#include<rpcFw\global.h>

extern "C"{
	#include<rpcFw\cJSON.h>
	}

class RPCFW_API DVarCodec{
public:
    Variant unpack(const char *);

	std::string pack(Variant &varObject,bool bFormat=false);
private:
    Variant parseItem(cJSON* pJsonStruct,char *keyName,bool bArray=false);
	cJSON * packItem(Variant &varObject);
};